package com.thinkgem.store.webservice;

import java.rmi.RemoteException;

import org.apache.axis2.AxisFault;

import com.thinkgem.store.webservice.WebService1Stub.CustShip;
import com.thinkgem.store.webservice.WebService1Stub.CustShipResponse;
import com.thinkgem.store.webservice.WebService1Stub.InvTransfer;
import com.thinkgem.store.webservice.WebService1Stub.InvTransferResponse;
import com.thinkgem.store.webservice.WebService1Stub.MfgtoSTK;
import com.thinkgem.store.webservice.WebService1Stub.MfgtoSTKResponse;
import com.thinkgem.store.webservice.WebService1Stub.Tqshipplan;
import com.thinkgem.store.webservice.WebService1Stub.TqshipplanResponse;

public class WebService1StubIns {
	public String getchuohuo(String chuhuojihua){
		String data="";
		WebService1Stub stub = null;
		try {
			stub = new WebService1Stub();
			System.out.println(stub._getServiceClient().getOptions().getTo().getAddress());
			stub._getServiceClient().getOptions().setProperty(    
		                org.apache.axis2.transport.http.HTTPConstants.CHUNKED,    
		                Boolean.FALSE);  
	        //stub._getServiceClient().getOptions().setProperty(Constants.Configuration.DISABLE_SOAP_ACTION,Boolean.TRUE);
	        stub._getServiceClient().getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.REUSE_HTTP_CLIENT, Boolean.TRUE);
	        
	        Tqshipplan tqshipplan0 = new Tqshipplan();
	        tqshipplan0.setCustnum(chuhuojihua);
	        TqshipplanResponse r = null;
	        r = stub.tqshipplan(tqshipplan0);
			data = r.getTqshipplanResult() ;
		} catch (AxisFault e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}catch (RemoteException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}  
		return data;
	}
	
	public String UptoEpiDtlByRcid(String rcid){
		String data="";
		WebService1Stub stub = null;
		try {
			stub = new WebService1Stub();
			stub._getServiceClient().getOptions().setProperty(    
		                org.apache.axis2.transport.http.HTTPConstants.CHUNKED,    
		                Boolean.FALSE);  
	        //stub._getServiceClient().getOptions().setProperty(Constants.Configuration.DISABLE_SOAP_ACTION,Boolean.TRUE);
	        stub._getServiceClient().getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.REUSE_HTTP_CLIENT, Boolean.TRUE);
	        
	        MfgtoSTK mfgtoSTK6 = new MfgtoSTK();
	        mfgtoSTK6.setMtkid(rcid);
	        MfgtoSTKResponse r = null;
	        r = stub.mfgtoSTK(mfgtoSTK6);
			data = r.getMfgtoSTKResult() ;
		} catch (AxisFault e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}catch (RemoteException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}  
		return data;
	}

	public boolean UptoEpiDtlByZcid(String zcid) {
		boolean data= false;
		WebService1Stub stub = null;
		try {
			stub = new WebService1Stub();
			stub._getServiceClient().getOptions().setProperty(    
		                org.apache.axis2.transport.http.HTTPConstants.CHUNKED,    
		                Boolean.FALSE);  
	        //stub._getServiceClient().getOptions().setProperty(Constants.Configuration.DISABLE_SOAP_ACTION,Boolean.TRUE);
	        stub._getServiceClient().getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.REUSE_HTTP_CLIENT, Boolean.TRUE);
	        
	        InvTransfer invTransfer10 = new InvTransfer();
	        invTransfer10.setItfid(zcid);
	        InvTransferResponse r = null;
	        r = stub.invTransfer(invTransfer10);
			data = r.getInvTransferResult() ;
		} catch (AxisFault e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}catch (RemoteException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}  
		return data;
	}
	
	public String UptoEpiDtlByCcid(String ccid) {
		String data= "";
		WebService1Stub stub = null;
		try {
			stub = new WebService1Stub();
			stub._getServiceClient().getOptions().setProperty(    
		                org.apache.axis2.transport.http.HTTPConstants.CHUNKED,    
		                Boolean.FALSE);  
	        //stub._getServiceClient().getOptions().setProperty(Constants.Configuration.DISABLE_SOAP_ACTION,Boolean.TRUE);
	        stub._getServiceClient().getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.REUSE_HTTP_CLIENT, Boolean.TRUE);
	        
	        CustShip custShip0 = new CustShip();
	        custShip0.setCusid(ccid);
	        CustShipResponse r = null;
	        r = stub.custShip(custShip0);
			data = r.getCustShipResult() ;
		} catch (AxisFault e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}catch (RemoteException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}  
		return data;
	}
}
